

/*
 * @(#)MaintUserImportDataAction.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.user.web;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.GlobalConstant;
import com.dcivision.framework.SystemFunctionConstant;
import com.dcivision.framework.web.AbstractMaintAction;

/**
  MaintUserImportDataAction.java

  This class is for maint import data.

    @author          Susan liu
    @company         DCIVision Limited
    @creation date   20/07/2004
    @version         $Revision: 1.3.2.3 $
*/

public class SelectSourceAction extends AbstractMaintAction {

  public static final String REVISION = "$Revision: 1.3.2.3 $";

  public SelectSourceAction() {
    super();
  }

  /**
   * getMajorDAOClassName
   *
   * @return  The class name of the major DAObject will be used in this action.
   */
  public String getMajorDAOClassName() {
    return(" ");
  }

  /**
   * getFunctionCode
   *
   * @return  The corresponding system function code of action.
   */
  public String getFunctionCode() {
    return(SystemFunctionConstant.SETUP_IMPORT_DATA);
  }

  
  
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException {
    SelectSourceForm selectSourceForm=(SelectSourceForm)form;
    String selected=selectSourceForm.getSelectSource();
    retrieveFunctionCode(request, response, mapping);
    request.setAttribute(GlobalConstant.FUNCTION_CODE_KEY,SystemFunctionConstant.SETUP_IMPORT_DATA);
    if(selected.equals("E")){
      return mapping.findForward("E");
    }    
    if(selected.equals("L")){
      return mapping.findForward("L");
    }    
    selectSourceForm.setSelectSource("E");
    return mapping.findForward("O");
  }
}
